﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HyperTraceConsole.Windows;

namespace HyperTraceConsole
{
    public partial class MainWindow : Form
    {

        #region Fields

        /// <summary>
        /// Reference to the Trace Viewer Window
        /// </summary>
        private TraceViewer _oTraceViewerWindow = null;

        /// <summary>
        /// Reference to the Trace Statistics Window
        /// </summary>
        private TraceStatsWindow _oTraceStatsWindow = null;

        /// <summary>
        /// Reference to the Trace Reconstruction Configuratio Console
        /// </summary>
        private TraceConfigConsole _oTraceConfigConsole = null;

        #endregion

        #region Methods

        public MainWindow()
        {
            InitializeComponent();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HyperTraceAbout oAboutWindow = new HyperTraceAbout();
            oAboutWindow.Show(this);
        }

        #endregion

        private void traceViewerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_oTraceViewerWindow == null)
            {
                _oTraceViewerWindow = new TraceViewer();
            }

            _oTraceViewerWindow.Show(this);
        }

        private void traceAnalyticsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_oTraceStatsWindow == null)
            {
                _oTraceStatsWindow = new TraceStatsWindow();
            }

            _oTraceStatsWindow.Show(this);
        }

        private void traceConfigurationConsoleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_oTraceConfigConsole == null)
            {
                _oTraceConfigConsole = new TraceConfigConsole();
            }

            _oTraceConfigConsole.Show(this);
        }
    }
}
